<template>
  <div class="tab-bar-item" @click="tabItemClick">
      <slot name="item-icon"></slot>
      <slot name="item-main"></slot>
  </div>
</template>

<script>
export default {
  name: "TabBarItem",
  props:{
    path:String,
  },
  methods:{
    tabItemClick(){
      if (this.$route.path!==this.path){
        this.$router.push(this.path)
      }
    }
  }
}
</script>

<style scoped>

</style>